var ui1 = document.querySelector(".ui1");
var ui2 = document.querySelector(".ui2");
var writerinfor = document.querySelector(".writerinfor");
var div11 = document.querySelector(".div1-1");
var divpuhuo = document.querySelector(".divpuhuo");
var div55 = document.querySelector(".div55");
var ui3 = document.querySelector(".ui3");
var ui7 = document.querySelector(".ui7");
var divfan = document.querySelector(".divfan");
var div44 = document.querySelector(".div44");




ui1.addEventListener("click", function() {
    writerinfor.style.display = "none";
    div11.style.marginTop = "20px";
});
ui2.addEventListener("click", function() {
    writerinfor.style.display = "block";
    div11.style.margin = "0";

});

// 点击后解禁
ui3.addEventListener("click", function() {
    div55.disabled = false;
    ui3.style.borderColor = "black";
})
ui7.addEventListener("click", function() {
    div55.disabled = false;
    ui7.style.borderColor = "black";
})
div44.addEventListener("click", function() {
        div55.disabled = false;
        div44.style.borderColor = "black";
    })
    // divpuhuo设置监听事件
divpuhuo.addEventListener("click", function() {

    if (ui3.value.trim().length == 0) {
        ui3.style.borderColor = "red";
        divfan.innerHTML = "用户名不能为空";
        div55.disabled = true;
    } else {
        ui7.style.borderColor = "black";
        divfan.innerHTML = "";
        if (ui7.value.trim().length == 0) {
            ui7.style.borderColor = "red";
            divfan.innerHTML = "密码不能为空";
            div55.disabled = true;
        } else {
            ui7.style.borderColor = "black";
            divfan.innerHTML = "";
            if (ui2.checked) {
                if (div44.value.trim().length == 0) {
                    div44.style.borderColor = "red";
                    divfan.innerHTML = "手机号码不能为空";
                    div55.disabled = true;
                } else {
                    div44.style.borderColor = "black";
                    divfan.innerHTML = "";

                }
            }
        }
    }

})